//系统-消息
import React, { Component } from 'react';
import {
    View,
    Text,
    TouchableOpacity,
    TextInput
} from 'react-native';

import Icon from 'react-native-vector-icons/Ionicons';
import { password_Style as styles } from '../../../../styles';


var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;

export default class Passwordbody_c extends Component {

    state = {
        show1: true,
        show2: true,
    }
    _onPress() {
        this.refs.password.blur();
    }

    render() {
        return (
            <View style={styles.pass_all}>

                <View style={styles.input}>
                    <TextInput
                        style={[styles.inputin, { width: width * 0.85 }]}
                        ref="password"
                        placeholder="请输入原密码"
                        password={true}
                        //输入为密码隐藏样式
                        secureTextEntry={this.state.show1}
                        clearButtonMode="always"
                        underlineColorAndroid="transparent" />

                    <TouchableOpacity style={styles.look} activeOpacity={1}
                        onPressIn={() => { [this.setState({ show1: !this.state.show1 }), this._onPress()] }}
                        onPressOut={() => { this.setState({ show1: !this.state.show1 }) }}>
                        <Icon
                            name={'md-eye'}
                            size={22}
                            color={'#aeaeae'} />
                    </TouchableOpacity>
                </View>


                <View style={styles.input}>
                    <TextInput
                        style={[styles.inputin, { width: width * 0.85 }]}
                        ref="password"
                        placeholder="请输入新密码（6-16位字母、数字）"
                        password={true}
                        //输入为密码隐藏样式
                        secureTextEntry={this.state.show2}
                        clearButtonMode="always"
                        underlineColorAndroid="transparent"/>

                    <TouchableOpacity style={styles.look} activeOpacity={1}
                        onPressIn={() => { [this.setState({ show2: !this.state.show2 }), this._onPress()] }}
                        onPressOut={() => { this.setState({ show2: !this.state.show2 }) }}>
                        <Icon
                            name={'md-eye'}
                            size={22}
                            color={'#aeaeae'} />
                    </TouchableOpacity>
                </View>

                <TouchableOpacity activeOpacity={1} style={[styles.buttonall, {
                    width: width * 0.85, elevation: 3,
                    shadowColor: 'black',
                    shadowOpacity: 1,
                    shadowRadius: 5}]}>
                    <Text style={styles.button1}>提 交</Text>
                </TouchableOpacity>

            </View>
        )
    }
}